import React from 'react';

interface UploadProps {
    onUpload: (type: 'images' | 'videos' | 'music', files: File[]) => void;
}

const Upload: React.FC<UploadProps> = ({ onUpload }) => {
    const handleFileChange = (type: 'images' | 'videos' | 'music', event: React.ChangeEvent<HTMLInputElement>) => {
        const files = Array.from(event.target.files || []);
        onUpload(type, files);
    };

    return (
        <div>
            <h3>上传素材</h3>
            <input type="file" multiple onChange={(e) => handleFileChange('images', e)} />
            <input type="file" multiple onChange={(e) => handleFileChange('videos', e)} />
            <input type="file" multiple onChange={(e) => handleFileChange('music', e)} />
        </div>
    );
};

export default Upload;